import Cookies from 'js-cookie'

const TokenKey = 'Admin-Token'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function setName(val) {
  return sessionStorage.setItem('userName', val)
}

export function getName() {
  return sessionStorage.getItem('userName')
}

export function removeName() {
  return sessionStorage.removeItem('userName')
}

// 存储session
export function setSession(key, val) {
  return sessionStorage.setItem(key, val)
}

// 读取session
export function getSession(key) {
  return sessionStorage.getItem(key)
}
